home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / news / thor / rexx / fse / previewmsg.fse < prev    next >
Text File  |  1998-05-24  |  918b  |  43 lines

  1. /* PreviewMsg.fse by Troels Walsted Hansen
  2. ** $VER: PreviewMsg.fse 1.0 (16.11.94)
  3. **
  4. ** An ARexx script that shows you (in THOR's messagetext listview) 
  5. ** what your message will look like when read by others in THOR.
  6. */
  7.  
  8. options results
  9.  
  10. /* needs FSE and THOR functions */
  11.  
  12. if(substr(address(),1,8) ~= "THOR_FSE") then
  13. do
  14.     say "This script should only be started from inside the FSE."
  15.     exit 20
  16. end
  17. else fseport = address()
  18.  
  19. p = ' ' || address() || ' ' || show('P',,)
  20. thorport = pos(' THOR.',p)
  21.  
  22. if thorport > 0 then thorport = word(substr(p,thorport+1),1)
  23. else
  24. do
  25.     say 'No THOR port found!'
  26.     exit 10
  27. end
  28.  
  29. /* preview msg text in THOR */
  30.  
  31. address(fseport)
  32. SAVEFILE 't:PreviewMsg.fse.temp.file'
  33.  
  34. address(thorport)
  35. THORTOFRONT
  36. SHOWTEXT 't:PreviewMsg.fse.temp.file'
  37. if(rc ~= 0) then REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
  38.  
  39. /* cleanup and exit */
  40.  
  41. address command 'delete >nil: t:PreviewMsg.fse.temp.file'
  42. exit
  43.